<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<script type="text/javascript" src="scripts/boot.js"></script>
<style type="text/css">
.ftitle{
    font-size:14px;
    font-weight:bold;
    padding:5px 0;
    margin-bottom:10px;
    border-bottom:1px solid #ccc;
}
.fitem{
    margin-bottom:10px;
}
.fitem label{
    display:inline-block;
    font-weight:bold;
    text-align:center;
    width: 29%;
}
</style>
</head>
<body style="border: 0px; margin: 0px; padding: 0px;width: 100%;height: 100%">
<form id="form1" method="post">
	<input class="mini-hidden" name="id"/>
	<div class="fitem">
		<br />
		<label>标题：</label>
		<input name="title" class="mini-textbox" vtype="maxLength:29" required="true" style="width: 220px"/>
	</div>
	<div class="fitem">
		<label>开始日期：</label>
		<input name="startDate" allowInput="false" required="true" class="mini-datepicker" style="width:220px;" />
	</div>
	<div class="fitem">
		<label>截至日期：</label>
		<input name="endDate" allowInput="false" required="true" class="mini-datepicker" style="width:220px;" />
	</div>
	<div class="fitem">
		<label>折扣费：</label>
		<input name="fee" class="mini-spinner" minValue="0" required="true" maxValue="1000000" style="width:220px;"/>
	</div>
</form>
<div style="text-align:center;padding-top: 100px;">
    <a class="mini-button" onclick="save();" style="width:60px;margin-right:20px;">确定</a>       
    <a class="mini-button" onclick="window.CloseOwnerWindow();" style="width:60px;">取消</a>       
</div>
<script type="text/javascript">
mini.parse();
var form = new mini.Form("form1");
//保存
function save(){
	var o = form.getData(true); 
    form.validate();
    if (form.isValid() == false) return;
    $.post('preferential_scheme_update.do',o,function(text){
    	if(text.success){
        	window.CloseOwnerWindow("succ");
        }else{
        	mini.alert("数据错误！");
        }
    },"json");
}

//标准方法接口定义
function SetData(row) {
	//跨页面传递的数据对象，克隆后才可以安全使用
	row = mini.clone(row);
	form.setData(row);
	form.setChanged(false);
}
</script>
</body>
</html>